package com.taoyibao.hongcanting.ui.home.views;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;

import com.taoyibao.hongcanting.R;
import com.taoyibao.hongcanting.base.BaseRelativeLayout;
import com.taoyibao.hongcanting.cache.SpUtils;

/**
 * @author TangAnna
 * @description:
 * @date :${DATA} 17:09
 */
public class ZengSongArea extends BaseRelativeLayout {
    private TextView mTextView;

    public ZengSongArea(Context context) {
        super(context);
    }

    public ZengSongArea(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ZengSongArea(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void initView(Context context, AttributeSet attrs, int defStyleAttr) {
        mTextView = findViewById(R.id.tv_zengsong);
        if (!TextUtils.isEmpty(SpUtils.getOtherSeatName())) {
            mTextView.setVisibility(VISIBLE);
            // “您正在给”+“桌号”+“号桌赠送菜品”
            mTextView.setText("您正在给" + SpUtils.getOtherSeatName() + "赠送菜品");
        } else {
            mTextView.setVisibility(GONE);
        }
    }

    @Override
    public void setData(Object data) {

    }

    @Override
    protected int bindLayout() {
        return R.layout.area_zengsong;
    }
}
